using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace Iori.DictCN {
    public partial class MiniDict : UserControl {
        private string UrlStringMain = "http://dict.cn/mini.php?q=";
        private string Word_;

        /// <summary>
        /// The Word To Search.
        /// </summary>
        [Browsable(true), Description("The Word To Search.")]
        public string Word {
            get {
                return Word_;
            }
            set {
                if (Word != value) {
                    Word_ = value;
                    if (Word_ != null) {
                        Open(Word_);
                    }
                }

            }
        }


        public MiniDict() {
            InitializeComponent();
        }


        /// <summary>
        /// Show The Word
        /// </summary>
        /// <param name="Word"></param>
        private void Open(string pWord) {
            Uri To = new Uri(UrlStringMain + Uri.EscapeUriString(pWord));
            wbMain.Navigate(To);
        }
    }
}
